import 'dart:async';

import 'package:clipboard/clipboard.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_styled_toast/flutter_styled_toast.dart';
import 'package:get/get.dart';
import 'package:intl/intl.dart' show DateFormat;
import 'package:qr_flutter/qr_flutter.dart';
import 'package:travel/extensions/date.dart';
import 'package:travel/model/hotel.dart';
import 'package:travel/routes/index.dart';
import 'package:travel/ui/dashed_line.dart';
import 'package:travel/utils/colors.dart';
import 'package:travel/utils/radian.dart';
import 'package:travel/utils/styles.dart';
import 'package:travel/utils/tools.dart';
import 'package:travel/screen/flutter_screenutil.dart';

/// 门票详情
class AdmissionInfoController extends GetxController {
  late AdmissionOrderStatusEnum admission;

  Timer? _timer;

  RxInt timeout = (2 * 3600 - 1).obs;

  @override
  void onInit() {
    admission = AdmissionOrderStatusEnum.unpaid;
    if (Get.arguments != null) {
      admission = Get.arguments['admission'];
    }
    super.onInit();
  }

  @override
  void onReady() {
    if (admission.value == AdmissionOrderStatusEnum.unpaid.value) {
      _timer = Timer.periodic(const Duration(seconds: 1), (Timer timer) {
        if (timeout.value == 0) {
          return _timer?.cancel();
        }
        timeout--;
      });
    }
    super.onReady();
  }

  @override
  void onClose() {
    clearTimeout();
    super.onClose();
  }

  void clearTimeout() {
    if (_timer != null && _timer!.isActive) {
      _timer?.cancel();
    }
  }
}

class AdmissionInfoView extends GetView<AdmissionInfoController> {
  const AdmissionInfoView({super.key});

  @override
  Widget build(BuildContext context) {
    return buildStack(context);
  }

  Widget buildStack(BuildContext context) {
    return Stack(
      children: [
        Container(
          height: 220,
          padding: EdgeInsets.symmetric(horizontal: 15.w),
          decoration: BoxDecoration(
              gradient: LinearGradient(colors: [
            ColorsUtils.rgba(52, 120, 246, 1),
            ColorsUtils.rgba(2, 167, 240, 1)
          ], stops: const [
            0.0,
            0.99
          ], transform: GradientRotation(RadianUtils.angleToRadian(90)))),
        ),
        Scaffold(
          backgroundColor: Colors.transparent,
          appBar: AppBar(
            automaticallyImplyLeading: false,
            backgroundColor: Colors.transparent,
            title: Container(
              height: 44,
              color: Colors.transparent,
              child: Row(
                children: [
                  Container(
                    width: 50.w,
                    alignment: Alignment.center,
                    child: IconButton(
                        onPressed: Get.back,
                        icon: Icon(
                          Icons.arrow_back_ios,
                          color: ColorsUtils.parseColorFromHexString(
                              ColorsUtils.colorFfff),
                          size: 20.w,
                        )),
                  ),
                  Expanded(
                      child: Center(
                    child: Text(
                      '订单详情',
                      style: StylesUtils.customTextStyle(fontSize: 18.sp),
                    ),
                  )),
                  Container(
                    width: 50.w,
                    alignment: Alignment.center,
                    child: IconButton(
                        onPressed: () {
                          ToolsUtils.openShare(context);
                        },
                        icon: ToolsUtils.assetImageSvg('u2611.svg',
                            width: 18.w, height: 18.h)),
                  )
                ],
              ),
            ),
            systemOverlayStyle: SystemUiOverlayStyle.light,
          ),
          body: CustomScrollView(
            slivers: [
              SliverToBoxAdapter(
                child: Stack(
                  children: [
                    Column(
                      children: [
                        Container(
                          height: 120,
                          padding: EdgeInsets.symmetric(horizontal: 15.w),
                          child: Column(
                            children: [
                              Container(
                                alignment: Alignment.topLeft,
                                padding: EdgeInsets.only(
                                    top: getPaddingTop(
                                        controller.admission.value)),
                                child: Text.rich(TextSpan(children: [
                                  TextSpan(
                                    text: controller.admission.label,
                                    style: StylesUtils.customTextStyle(
                                        fontSize: 30.sp),
                                  ),
                                  WidgetSpan(
                                      child: Icon(
                                        Icons.arrow_forward_ios,
                                        size: 15.sp,
                                        color:
                                            ColorsUtils.parseColorFromHexString(
                                                ColorsUtils.colorFfff),
                                      ),
                                      alignment: PlaceholderAlignment.middle)
                                ])),
                              ),
                              tipsWidget(controller.admission.value),
                            ],
                          ),
                        ),
                        buildStackContainer(controller.admission.value),
                      ],
                    ),
                    Positioned(
                        left: 0,
                        right: 0,
                        bottom: 0,
                        child: buildBottom(controller.admission.value))
                  ],
                ),
              ),
              SliverToBoxAdapter(
                child: getAdmissionInfo(controller.admission.value),
              )
            ],
          ),
        ),
      ],
    );
  }

  Widget buildStackContainer(int status) {
    double height = 0.0;
    if (AdmissionOrderStatusEnum.unpaid.value == status) {
      height = 135.0 - 40.0;
    }
    if (AdmissionOrderStatusEnum.unused.value == status) {
      height = 100.0 - 40.0;
    }
    if (AdmissionOrderStatusEnum.used.value == status) {
      height = 100.0 - 40.0;
    }
    if (AdmissionOrderStatusEnum.cancelled.value == status) {
      height = 50.0 - 40.0;
    }
    return Container(
      height: height,
      color: ColorsUtils.parseColorFromHexString(ColorsUtils.colorF7f7),
    );
  }

  Widget tipsWidget(int status) {
    switch (status) {
      case 1:
        return Container(
          padding: EdgeInsets.only(top: 15.h),
          alignment: Alignment.topLeft,
          child: Text(
            getTipsByStatus(controller.admission.value),
            style: StylesUtils.textStyle(
                color: ColorsUtils.rgba(255, 255, 255, 0.847058823529412)),
          ),
        );
    }
    return Container();
  }

  String getTipsByStatus(int status) {
    switch (status) {
      case 1:
        return '库存有限，请尽快完成付款，过时将自动取消';
      default:
        return '';
    }
  }

  double? getHeightByStatus(int status) {
    switch (status) {
      case 1:
        return 135;
      case 2:
        return 100;
      case 3:
        return 100;
      case 4:
        return 50;
    }
    return null;
  }

  Widget buildBottom(int status) {
    /// 待支付
    if (AdmissionOrderStatusEnum.unpaid.value == status) {
      return Center(
        child: Container(
          height: 135,
          width: 345,
          padding: EdgeInsets.symmetric(horizontal: 15.w),
          decoration: BoxDecoration(
              color: Colors.white, borderRadius: BorderRadius.circular(8.w)),
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              Container(
                height: 40,
                alignment: Alignment.centerLeft,
                child: Wrap(
                  spacing: 10,
                  crossAxisAlignment: WrapCrossAlignment.center,
                  children: [
                    Text.rich(TextSpan(children: [
                      WidgetSpan(
                          child: ToolsUtils.assetImageSvg('u3267.svg',
                              width: 16.w, height: 16.h),
                          alignment: PlaceholderAlignment.middle),
                      TextSpan(
                          text: ' 随买随用',
                          style: StylesUtils.customTextStyle(
                              fontSize: 15.sp, color: ColorsUtils.color3333))
                    ])),
                    Text.rich(TextSpan(children: [
                      WidgetSpan(
                          child: ToolsUtils.assetImageSvg('u3267.svg',
                              width: 16.w, height: 16.h),
                          alignment: PlaceholderAlignment.middle),
                      TextSpan(
                          text: ' 随时退',
                          style: StylesUtils.customTextStyle(
                              fontSize: 15.sp, color: ColorsUtils.color3333))
                    ])),
                    Text.rich(TextSpan(children: [
                      WidgetSpan(
                          child: ToolsUtils.assetImageSvg('u3267.svg',
                              width: 16.w, height: 16.h),
                          alignment: PlaceholderAlignment.middle),
                      TextSpan(
                          text: ' 过期退',
                          style: StylesUtils.customTextStyle(
                              fontSize: 15.sp, color: ColorsUtils.color3333))
                    ])),
                  ],
                ),
              ),
              Container(
                alignment: Alignment.centerLeft,
                padding: const EdgeInsets.only(top: 7, bottom: 15),
                child: Wrap(
                  spacing: 6,
                  crossAxisAlignment: WrapCrossAlignment.center,
                  children: [
                    Text(
                      '剩余时间',
                      style: StylesUtils.customTextStyle(
                          fontSize: 13.sp, color: ColorsUtils.color7979),
                    ),
                    Obx(() => Text(
                          controller.timeout > 0
                              ? _durationTransform(controller.timeout.value)
                              : '已超时',
                          style: StylesUtils.customTextStyle(
                              fontSize: 13.sp, color: ColorsUtils.colorD900),
                        ))
                  ],
                ),
              ),
              Wrap(
                spacing: 15.w,
                crossAxisAlignment: WrapCrossAlignment.center,
                alignment: WrapAlignment.start,
                children: [
                  Container(
                    constraints:
                        const BoxConstraints.expand(width: 105, height: 35),
                    alignment: Alignment.center,
                    decoration: BoxDecoration(
                        borderRadius: BorderRadius.circular(5.w),
                        border: Border.all(
                            color: ColorsUtils.parseColorFromHexString(
                                ColorsUtils.colorCccc))),
                    child: TextButton(
                        onPressed: () {},
                        child: Text(
                          '取消订单',
                          style: StylesUtils.customTextStyle(
                              fontSize: 14.sp, color: ColorsUtils.color3333),
                        )),
                  ),
                  Container(
                    constraints:
                        const BoxConstraints.expand(width: 105, height: 35),
                    alignment: Alignment.center,
                    decoration: BoxDecoration(
                        borderRadius: BorderRadius.circular(5.w),
                        //linear-gradient(90deg, rgba(52, 120, 246, 1) 0%, rgba(2, 167, 240, 1) 99%)
                        gradient: LinearGradient(
                            colors: [
                              ColorsUtils.rgba(52, 120, 246, 1),
                              ColorsUtils.rgba(2, 167, 240, 1)
                            ],
                            stops: const [
                              0.0,
                              0.99
                            ],
                            transform: GradientRotation(
                                RadianUtils.angleToRadian(90)))),
                    child: TextButton(
                        onPressed: () {},
                        child: Text(
                          '去支付',
                          style: StylesUtils.customTextStyle(fontSize: 14.sp),
                        )),
                  ),
                ],
              )
            ],
          ),
        ),
      );
    }

    /// 未使用
    if (AdmissionOrderStatusEnum.unused.value == status) {
      return Center(
        child: Container(
          height: 100,
          width: 345,
          padding: EdgeInsets.symmetric(horizontal: 15.w),
          decoration: BoxDecoration(
              color: Colors.white, borderRadius: BorderRadius.circular(8.w)),
          child: Column(
            mainAxisAlignment: MainAxisAlignment.start,
            children: [
              Container(
                height: 40,
                alignment: Alignment.centerLeft,
                child: Wrap(
                  spacing: 10,
                  crossAxisAlignment: WrapCrossAlignment.center,
                  children: [
                    Text.rich(TextSpan(children: [
                      WidgetSpan(
                          child: ToolsUtils.assetImageSvg('u3267.svg',
                              width: 16.w, height: 16.h),
                          alignment: PlaceholderAlignment.middle),
                      TextSpan(
                          text: ' 随买随用',
                          style: StylesUtils.customTextStyle(
                              fontSize: 15.sp, color: ColorsUtils.color3333))
                    ])),
                    Text.rich(TextSpan(children: [
                      WidgetSpan(
                          child: ToolsUtils.assetImageSvg('u3267.svg',
                              width: 16.w, height: 16.h),
                          alignment: PlaceholderAlignment.middle),
                      TextSpan(
                          text: ' 随时退',
                          style: StylesUtils.customTextStyle(
                              fontSize: 15.sp, color: ColorsUtils.color3333))
                    ])),
                    Text.rich(TextSpan(children: [
                      WidgetSpan(
                          child: ToolsUtils.assetImageSvg('u3267.svg',
                              width: 16.w, height: 16.h),
                          alignment: PlaceholderAlignment.middle),
                      TextSpan(
                          text: ' 过期退',
                          style: StylesUtils.customTextStyle(
                              fontSize: 15.sp, color: ColorsUtils.color3333))
                    ])),
                  ],
                ),
              ),
              Container(
                padding: EdgeInsets.only(top: 10.h),
                alignment: Alignment.centerLeft,
                child: Container(
                  constraints:
                      const BoxConstraints.expand(width: 105, height: 35),
                  alignment: Alignment.center,
                  decoration: BoxDecoration(
                      borderRadius: BorderRadius.circular(5.w),
                      border: Border.all(
                          color: ColorsUtils.parseColorFromHexString(
                              ColorsUtils.colorCccc))),
                  child: TextButton(
                      onPressed: () {
                        Get.toNamed(RoutePath.orderAdmissionUnsubscribe);
                      },
                      child: Text(
                        '退订',
                        style: StylesUtils.customTextStyle(
                            fontSize: 14.sp, color: ColorsUtils.color3333),
                      )),
                ),
              )
            ],
          ),
        ),
      );
    }

    /// 已使用
    if (AdmissionOrderStatusEnum.used.value == status) {
      return Center(
        child: Container(
          height: 100,
          width: 345,
          padding: EdgeInsets.symmetric(horizontal: 15.w),
          alignment: Alignment.centerLeft,
          decoration: BoxDecoration(
              color: Colors.white, borderRadius: BorderRadius.circular(8.w)),
          child: Column(
            mainAxisAlignment: MainAxisAlignment.start,
            children: [
              Container(
                padding: const EdgeInsets.only(top: 15),
                alignment: Alignment.centerLeft,
                child: Text(
                  '期待您的下次光临',
                  style: StylesUtils.customTextStyle(
                      fontSize: 15.sp, color: ColorsUtils.color7979),
                ),
              ),
              Container(
                padding: EdgeInsets.only(top: 10.h),
                alignment: Alignment.centerLeft,
                child: Container(
                  constraints:
                      const BoxConstraints.expand(width: 105, height: 35),
                  alignment: Alignment.center,
                  decoration: BoxDecoration(
                      borderRadius: BorderRadius.circular(5.w),
                      border: Border.all(
                          color: ColorsUtils.parseColorFromHexString(
                              ColorsUtils.colorCccc))),
                  child: TextButton(
                      onPressed: () {
                        Get.toNamed(RoutePath.comment);
                      },
                      child: Text(
                        '去评论',
                        style: StylesUtils.customTextStyle(
                            fontSize: 14.sp, color: ColorsUtils.color3333),
                      )),
                ),
              )
            ],
          ),
        ),
      );
    }

    /// 已取消
    if (AdmissionOrderStatusEnum.cancelled.value == status) {
      return Center(
        child: Container(
          height: 50,
          width: 345,
          padding: EdgeInsets.all(15.w),
          alignment: Alignment.centerLeft,
          decoration: BoxDecoration(
              color: Colors.white, borderRadius: BorderRadius.circular(8.w)),
          child: Text(
            '期待您的下次光临',
            style: StylesUtils.customTextStyle(
                fontSize: 15.sp, color: ColorsUtils.color7979),
          ),
        ),
      );
    }
    return Container();
  }

  String intlTime(int time) {
    DateFormat fmt = DateFormat('HH:mm:ss', 'zh_CN');
    return fmt.format(DateTime.fromMillisecondsSinceEpoch(
        Duration(seconds: time).inMilliseconds));
  }

  ///时间转换 将秒转换为小时分钟
  String _durationTransform(int seconds) {
    return Duration(seconds: seconds).toZhString();
  }

  Widget getAdmissionInfo(int value) {
    switch (value) {
      case 1:
        return const AdmissionUnpaid();
      case 2:
        return const AdmissionUnused();
      case 3:
        return const AdmissionCancelled();
      case 4:
        return const AdmissionUsed();
      default:
        return Container();
    }
  }

  double getPaddingTop(int value) {
    if (value == AdmissionOrderStatusEnum.unused.value) {
      return 20.0;
    }
    if (value == AdmissionOrderStatusEnum.cancelled.value) {
      return 20.0;
    }
    if (value == AdmissionOrderStatusEnum.used.value) {
      return 20.0;
    }
    return 0.0;
  }
}

/// 待支付
class AdmissionUnpaid extends StatefulWidget {
  const AdmissionUnpaid({super.key});

  @override
  State<AdmissionUnpaid> createState() => _AdmissionUnpaidState();
}

class _AdmissionUnpaidState extends State<AdmissionUnpaid> {
  @override
  Widget build(BuildContext context) {
    return Transform.translate(
        offset: const Offset(0, -0.09),
        child: Container(
          padding: EdgeInsets.only(top: 10.h),
          color: ColorsUtils.parseColorFromHexString(ColorsUtils.colorF7f7),
          alignment: Alignment.center,
          child: SizedBox(
            width: 345,
            child: Column(
              children: [
                Container(
                  height: 100,
                  padding: EdgeInsets.symmetric(vertical: 10, horizontal: 15.w),
                  decoration: BoxDecoration(
                      color: Colors.white,
                      borderRadius: BorderRadius.circular(8.w)),
                  child: Column(
                    children: [
                      Expanded(
                          child: Row(
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: [
                          Text.rich(TextSpan(children: [
                            TextSpan(
                                text: '在线支付',
                                style: StylesUtils.customTextStyle(
                                    color: ColorsUtils.color3333,
                                    fontSize: 16.sp,
                                    fontWeight: FontWeight.w700)),
                            TextSpan(
                                text: ' ￥ ',
                                style: StylesUtils.customTextStyle(
                                    fontSize: 16.sp,
                                    color: ColorsUtils.colorD900)),
                            TextSpan(
                                text: '60',
                                style: StylesUtils.customTextStyle(
                                    fontSize: 18.sp,
                                    color: ColorsUtils.colorD900))
                          ])),
                          Text(
                            '费用明细',
                            style: StylesUtils.customTextStyle(
                                color: ColorsUtils.color6799, fontSize: 12.sp),
                          )
                        ],
                      )),
                      Expanded(
                          child: Container(
                              alignment: Alignment.centerLeft,
                              child: Text.rich(TextSpan(
                                  children: [
                                    TextSpan(
                                        text: '订单号 231125173310086 ',
                                        style: StylesUtils.customTextStyle(
                                            fontSize: 12.sp,
                                            color: ColorsUtils.color6666)),
                                    WidgetSpan(
                                        child: ToolsUtils.assetImageSvg(
                                            'u1757.svg',
                                            width: 12.w,
                                            height: 12.h),
                                        alignment: PlaceholderAlignment.middle)
                                  ],
                                  recognizer: TapGestureRecognizer()
                                    ..onTap = () {
                                      FlutterClipboard.copy('231125173310086')
                                          .then((value) => showToast('复制完毕',
                                              context: context,
                                              position:
                                                  StyledToastPosition.bottom))
                                          .catchError((err) => showToast('复制失败',
                                              context: context,
                                              position:
                                                  StyledToastPosition.bottom));
                                    }))))
                    ],
                  ),
                ),
                Container(
                  margin: EdgeInsets.only(top: 10.h),
                  padding: EdgeInsets.symmetric(vertical: 10, horizontal: 15.w),
                  decoration: BoxDecoration(
                      color: Colors.white,
                      borderRadius: BorderRadius.circular(8.w)),
                  child: Column(
                    children: [
                      Row(
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: [
                          Text(
                            '故宫博物馆学生票 x2份',
                            style: StylesUtils.customTextStyle(
                              color: ColorsUtils.color3333,
                            ),
                          ),
                          Icon(
                            Icons.arrow_forward_ios,
                            size: 12.sp,
                            color: ColorsUtils.parseColorFromHexString(
                                ColorsUtils.colorCccc),
                          )
                        ],
                      ),
                      Container(
                        padding: EdgeInsets.only(top: 8.h),
                        alignment: Alignment.centerLeft,
                        child: Text.rich(TextSpan(
                            text: '使用日期：',
                            style: StylesUtils.customTextStyle(
                                fontSize: 12.sp, color: ColorsUtils.color9999),
                            children: [
                              TextSpan(
                                  text: '2023-11-26 星期六',
                                  style: StylesUtils.customTextStyle(
                                      fontSize: 12.sp,
                                      color: ColorsUtils.colorFf99))
                            ])),
                      ),
                      Container(
                        padding: EdgeInsets.symmetric(vertical: 15.h),
                        alignment: Alignment.centerLeft,
                        child: Text(
                          '凭「电子凭证」直接验证使用',
                          style: StylesUtils.customTextStyle(
                              color: ColorsUtils.color3333, fontSize: 15.sp),
                        ),
                      ),
                      SizedBox(
                        height: 80,
                        child: Row(
                          mainAxisAlignment: MainAxisAlignment.start,
                          children: [
                            Container(
                              width: 35,
                              alignment: Alignment.center,
                              decoration: BoxDecoration(
                                  borderRadius: BorderRadius.only(
                                      topLeft: Radius.circular(8.w),
                                      bottomLeft: Radius.circular(8.w)),
                                  color: ColorsUtils.rgba(51, 51, 51, 1)),
                              child: Text(
                                '凭\n证',
                                style: StylesUtils.customTextStyle(
                                    fontSize: 12.sp),
                              ),
                            ),
                            Expanded(
                                child: Container(
                              padding: EdgeInsets.only(left: 10.w),
                              decoration: BoxDecoration(
                                  color: ColorsUtils.rgba(250, 250, 250, 1),
                                  borderRadius: BorderRadius.only(
                                      topRight: Radius.circular(8.w),
                                      bottomRight: Radius.circular(8.w))),
                              alignment: Alignment.centerLeft,
                              child: Text(
                                '凭证将在订单确认后发放',
                                style: StylesUtils.customTextStyle(
                                    fontSize: 12.sp,
                                    color: ColorsUtils.color6666),
                              ),
                            ))
                          ],
                        ),
                      ),
                      Container(
                        padding: EdgeInsets.symmetric(vertical: 15.h),
                        child: Column(
                          children: [
                            Container(
                              alignment: Alignment.centerLeft,
                              child: Text(
                                '取票、入园时间/地址',
                                style: StylesUtils.customTextStyle(
                                    fontSize: 17.sp,
                                    color: ColorsUtils.color3333),
                              ),
                            ),
                            Container(
                              padding: EdgeInsets.only(top: 10.h, bottom: 5.h),
                              alignment: Alignment.centerLeft,
                              child: Text(
                                '08:30-16:30',
                                style: StylesUtils.customTextStyle(
                                    fontSize: 12.sp,
                                    color: ColorsUtils.color6666),
                              ),
                            ),
                            Row(
                              mainAxisAlignment: MainAxisAlignment.spaceBetween,
                              children: [
                                Text(
                                  '故宫博物售票处',
                                  style: StylesUtils.customTextStyle(
                                      fontSize: 12.sp,
                                      color: ColorsUtils.color6666),
                                ),
                                RichText(
                                    text: TextSpan(
                                        text: '复制',
                                        style: StylesUtils.customTextStyle(
                                            fontSize: 12.sp,
                                            color: ColorsUtils.color6799),
                                        recognizer: TapGestureRecognizer()
                                          ..onTap = () {
                                            FlutterClipboard.copy('故宫博物售票处')
                                                .then((value) => showToast(
                                                    '复制完毕',
                                                    context: context,
                                                    position:
                                                        StyledToastPosition
                                                            .bottom))
                                                .catchError((err) => showToast(
                                                    '复制失败',
                                                    context: context,
                                                    position:
                                                        StyledToastPosition
                                                            .bottom));
                                          }))
                              ],
                            )
                          ],
                        ),
                      ),
                      Container(
                        padding: EdgeInsets.only(top: 5.h),
                        child: Column(
                          children: [
                            Row(
                              mainAxisAlignment: MainAxisAlignment.spaceBetween,
                              children: [
                                Text(
                                  '退改规则',
                                  style: StylesUtils.customTextStyle(
                                      fontSize: 17.sp,
                                      color: ColorsUtils.color3333),
                                ),
                                Icon(
                                  Icons.keyboard_arrow_down_outlined,
                                  size: 12.sp,
                                  color: ColorsUtils.parseColorFromHexString(
                                      ColorsUtils.colorCccc),
                                )
                              ],
                            ),
                            Container(
                              alignment: Alignment.centerLeft,
                              padding: EdgeInsets.only(top: 5.h),
                              child: Row(
                                children: [
                                  Container(
                                    constraints: BoxConstraints.expand(
                                        width: 50.w, height: 20.h),
                                    alignment: Alignment.center,
                                    decoration: BoxDecoration(
                                        color: ColorsUtils.rgba(5, 178, 136, 1),
                                        borderRadius: BorderRadius.only(
                                            topLeft: Radius.circular(3.w),
                                            bottomLeft: Radius.circular(3.w))),
                                    child: Text(
                                      '无忧退',
                                      style: StylesUtils.customTextStyle(
                                          fontSize: 12.sp),
                                    ),
                                  ),
                                  Container(
                                    height: 20.h,
                                    alignment: Alignment.centerLeft,
                                    decoration: BoxDecoration(
                                        border: Border(
                                            bottom: BorderSide(
                                                color: ColorsUtils.rgba(
                                                    5, 178, 136, 1)))),
                                    child: Text(
                                      ' 随时退 • 过期自动退',
                                      style: StylesUtils.textStyle(
                                        color: ColorsUtils.rgba(5, 178, 136, 1),
                                        fontSize: 12.sp,
                                      ),
                                    ),
                                  )
                                ],
                              ),
                            )
                          ],
                        ),
                      ),
                      Container(
                        padding: EdgeInsets.symmetric(vertical: 20.h),
                        alignment: Alignment.centerLeft,
                        child: Row(
                          mainAxisAlignment: MainAxisAlignment.spaceBetween,
                          children: [
                            Text(
                              '景区意外险（含新冠保障）x2份',
                              style: StylesUtils.customTextStyle(
                                  fontSize: 16.sp,
                                  color: ColorsUtils.color3333),
                            ),
                            Icon(
                              Icons.arrow_forward_ios,
                              size: 12.sp,
                              color: ColorsUtils.parseColorFromHexString(
                                  ColorsUtils.colorCccc),
                            )
                          ],
                        ),
                      )
                    ],
                  ),
                ),
                Container(
                  margin: EdgeInsets.only(top: 10.h),
                  padding: EdgeInsets.symmetric(vertical: 15, horizontal: 15.w),
                  decoration: BoxDecoration(
                      color: Colors.white,
                      borderRadius: BorderRadius.circular(8.w)),
                  child: Column(
                    children: [
                      Container(
                        alignment: Alignment.centerLeft,
                        padding: EdgeInsets.only(bottom: 10.h),
                        child: Text(
                          '预定信息',
                          style: StylesUtils.customTextStyle(
                              fontSize: 17.sp, color: ColorsUtils.color3333),
                        ),
                      ),
                      Row(
                        children: [
                          Container(
                            width: 80.w,
                            alignment: Alignment.centerLeft,
                            child: Text(
                              '出行人',
                              style: StylesUtils.customTextStyle(
                                  color: ColorsUtils.color9999,
                                  fontSize: 13.sp),
                            ),
                          ),
                          Expanded(
                              child: Container(
                            alignment: Alignment.centerLeft,
                            child: Text(
                              '柳宗元',
                              style: StylesUtils.customTextStyle(
                                  color: ColorsUtils.color3333,
                                  fontSize: 13.sp),
                            ),
                          ))
                        ],
                      ),
                      Container(
                        padding: EdgeInsets.symmetric(vertical: 15.h),
                        child: Row(
                          children: [
                            Container(
                              width: 80.w,
                              alignment: Alignment.centerLeft,
                              child: Text(
                                '联系信息',
                                style: StylesUtils.customTextStyle(
                                    color: ColorsUtils.color9999,
                                    fontSize: 13.sp),
                              ),
                            ),
                            Expanded(
                                child: Container(
                              alignment: Alignment.centerLeft,
                              child: Text(
                                '柳宗元  136****5678',
                                style: StylesUtils.customTextStyle(
                                    color: ColorsUtils.color3333,
                                    fontSize: 13.sp),
                              ),
                            ))
                          ],
                        ),
                      ),
                      Row(
                        children: [
                          Container(
                            width: 80.w,
                            alignment: Alignment.centerLeft,
                            child: Text(
                              '合同条款',
                              style: StylesUtils.customTextStyle(
                                  color: ColorsUtils.color9999,
                                  fontSize: 13.sp),
                            ),
                          ),
                          Expanded(
                              child: Row(
                                  mainAxisAlignment:
                                      MainAxisAlignment.spaceBetween,
                                  children: [
                                Text(
                                  '2024-02-01 12:14:17',
                                  style: StylesUtils.customTextStyle(
                                      color: ColorsUtils.color3333,
                                      fontSize: 13.sp),
                                ),
                                RichText(
                                    text: TextSpan(
                                        text: '详情',
                                        style: StylesUtils.customTextStyle(
                                            fontSize: 12.sp,
                                            color: ColorsUtils.color6799),
                                        recognizer: TapGestureRecognizer()
                                          ..onTap = () {}))
                              ]))
                        ],
                      ),
                    ],
                  ),
                ),
                Container(
                  height: 90,
                  margin: EdgeInsets.only(top: 10.h),
                  padding: const EdgeInsets.all(15),
                  decoration: BoxDecoration(
                      color: Colors.white,
                      borderRadius: BorderRadius.circular(8.w),
                      border: Border.all(
                          color: ColorsUtils.rgba(252, 252, 252, 1))),
                  child: Row(
                    children: [
                      Center(
                          child: ClipRRect(
                        borderRadius: BorderRadius.circular(5.w),
                        child: Image.network(
                          'https://img1.baidu.com/it/u=1110297879,3226503213&fm=253&fmt=auto&app=138&f=JPEG?w=600&h=401',
                          width: 60,
                          height: 60,
                          fit: BoxFit.fill,
                        ),
                      )),
                      Expanded(
                          child: Container(
                        padding: EdgeInsets.only(left: 10.w),
                        alignment: Alignment.centerLeft,
                        child: Text(
                          '故宫博物馆',
                          style: StylesUtils.customTextStyle(
                              color: ColorsUtils.color3333, fontSize: 16.sp),
                        ),
                      )),
                      Center(
                        child: RichText(
                          text: TextSpan(
                              text: '景点详情 ',
                              style: StylesUtils.customTextStyle(
                                  fontSize: 12.sp,
                                  color: ColorsUtils.color9999),
                              children: [
                                WidgetSpan(
                                    child: Icon(
                                      Icons.arrow_forward_ios,
                                      size: 12.sp,
                                      color:
                                          ColorsUtils.parseColorFromHexString(
                                              ColorsUtils.color9999),
                                    ),
                                    alignment: PlaceholderAlignment.middle)
                              ],
                              recognizer: TapGestureRecognizer()
                                ..onTap = () {}),
                        ),
                      )
                    ],
                  ),
                ),
                Container(
                  padding: EdgeInsets.only(top: 20.h),
                  alignment: Alignment.center,
                  child: Text(
                    '本产品由小默旅行发展有限公司及',
                    style: StylesUtils.customTextStyle(
                        fontSize: 12.sp, color: ColorsUtils.color9999),
                  ),
                ),
                Container(
                  padding: EdgeInsets.only(top: 5.h, bottom: 50.h),
                  alignment: Alignment.center,
                  child: Text(
                    '具有合法资质的供应商提供相关服务',
                    style: StylesUtils.customTextStyle(
                        color: ColorsUtils.color9999, fontSize: 12.sp),
                  ),
                )
              ],
            ),
          ),
        ));
  }
}

/// 未使用
class AdmissionUnused extends StatefulWidget {
  const AdmissionUnused({super.key});

  @override
  State<AdmissionUnused> createState() => _AdmissionUnusedState();
}

class _AdmissionUnusedState extends State<AdmissionUnused> {
  @override
  Widget build(BuildContext context) {
    return Transform.translate(
      offset: const Offset(0, -0.09),
      child: Container(
        padding: EdgeInsets.only(top: 10.h),
        color: ColorsUtils.parseColorFromHexString(ColorsUtils.colorF7f7),
        alignment: Alignment.center,
        child: SizedBox(
          width: 345,
          child: Column(
            children: [
              Container(
                padding: EdgeInsets.symmetric(vertical: 10.w, horizontal: 15.w),
                decoration: BoxDecoration(
                    color: Colors.white,
                    borderRadius: BorderRadius.circular(8.w)),
                child: Column(
                  children: [
                    Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [
                        Text(
                          '故宫博物馆学生票 x2份',
                          style: StylesUtils.customTextStyle(
                              color: ColorsUtils.color3333),
                        ),
                        Icon(
                          Icons.arrow_forward_ios,
                          color: ColorsUtils.parseColorFromHexString(
                            ColorsUtils.color9999,
                          ),
                          size: 12.sp,
                        )
                      ],
                    ),
                    Container(
                      padding: EdgeInsets.only(top: 8.h),
                      alignment: Alignment.centerLeft,
                      child: Text.rich(TextSpan(
                          text: '使用日期：',
                          style: StylesUtils.customTextStyle(
                              fontSize: 12.sp, color: ColorsUtils.color9999),
                          children: [
                            TextSpan(
                                text: '2023-11-26 星期六',
                                style: StylesUtils.customTextStyle(
                                    fontSize: 12.sp,
                                    color: ColorsUtils.colorFf99))
                          ])),
                    ),
                    Container(
                      padding: EdgeInsets.symmetric(vertical: 15.h),
                      alignment: Alignment.centerLeft,
                      child: Text(
                        '凭「电子凭证」直接验证使用',
                        style: StylesUtils.customTextStyle(
                            color: ColorsUtils.color3333, fontSize: 15.sp),
                      ),
                    ),
                    SizedBox(
                      height: 220,
                      child: Row(
                        mainAxisAlignment: MainAxisAlignment.start,
                        children: [
                          Container(
                            width: 35,
                            alignment: Alignment.center,
                            decoration: BoxDecoration(
                                borderRadius: BorderRadius.only(
                                    topLeft: Radius.circular(8.w),
                                    bottomLeft: Radius.circular(8.w)),
                                color: ColorsUtils.rgba(51, 51, 51, 1)),
                            child: Text(
                              '使\n用\n凭\n证',
                              style:
                                  StylesUtils.customTextStyle(fontSize: 12.sp),
                            ),
                          ),
                          Expanded(
                              child: Container(
                            decoration: BoxDecoration(
                                color: ColorsUtils.rgba(250, 250, 250, 1),
                                borderRadius: BorderRadius.only(
                                    topRight: Radius.circular(8.w),
                                    bottomRight: Radius.circular(8.w))),
                            alignment: Alignment.center,
                            child: SizedBox(
                              width: 140,
                              height: 185,
                              child: Column(
                                children: [
                                  Container(
                                    alignment: Alignment.center,
                                    padding: const EdgeInsets.only(bottom: 5),
                                    child: Text(
                                      '辅助码:123456789',
                                      style: StylesUtils.customTextStyle(
                                          color: ColorsUtils.color3333,
                                          fontSize: 12.sp),
                                    ),
                                  ),
                                  SizedBox(
                                    width: 140,
                                    height: 140,
                                    child: QrImageView(
                                      data: '1234567890',
                                      version: QrVersions.auto,
                                      size: 140.0,
                                      padding: EdgeInsets.zero,
                                    ),
                                  ),
                                  Container(
                                    alignment: Alignment.center,
                                    padding: const EdgeInsets.only(top: 10),
                                    child: InkWell(
                                        onTap: () {},
                                        child: Text(
                                          '保存到相册',
                                          style: StylesUtils.customTextStyle(
                                              fontSize: 12.sp,
                                              color: ColorsUtils.color6799),
                                        )),
                                  )
                                ],
                              ),
                            ),
                          ))
                        ],
                      ),
                    ),
                    Container(
                      padding: EdgeInsets.symmetric(vertical: 15.h),
                      child: Column(
                        children: [
                          Container(
                            alignment: Alignment.centerLeft,
                            child: Text(
                              '取票、入园时间/地址',
                              style: StylesUtils.customTextStyle(
                                  fontSize: 17.sp,
                                  color: ColorsUtils.color3333),
                            ),
                          ),
                          Container(
                            padding: EdgeInsets.only(top: 10.h, bottom: 5.h),
                            alignment: Alignment.centerLeft,
                            child: Text(
                              '08:30-16:30',
                              style: StylesUtils.customTextStyle(
                                  fontSize: 12.sp,
                                  color: ColorsUtils.color6666),
                            ),
                          ),
                          Row(
                            mainAxisAlignment: MainAxisAlignment.spaceBetween,
                            children: [
                              Text(
                                '故宫博物售票处',
                                style: StylesUtils.customTextStyle(
                                    fontSize: 12.sp,
                                    color: ColorsUtils.color6666),
                              ),
                              RichText(
                                  text: TextSpan(
                                      text: '复制',
                                      style: StylesUtils.customTextStyle(
                                          fontSize: 12.sp,
                                          color: ColorsUtils.color6799),
                                      recognizer: TapGestureRecognizer()
                                        ..onTap = () {
                                          FlutterClipboard.copy('故宫博物售票处')
                                              .then((value) => showToast('复制完毕',
                                                  context: context,
                                                  position: StyledToastPosition
                                                      .bottom))
                                              .catchError((err) => showToast(
                                                  '复制失败',
                                                  context: context,
                                                  position: StyledToastPosition
                                                      .bottom));
                                        }))
                            ],
                          )
                        ],
                      ),
                    ),
                    Container(
                      padding: EdgeInsets.only(top: 5.h),
                      child: Column(
                        children: [
                          Row(
                            mainAxisAlignment: MainAxisAlignment.spaceBetween,
                            children: [
                              Text(
                                '退改规则',
                                style: StylesUtils.customTextStyle(
                                    fontSize: 17.sp,
                                    color: ColorsUtils.color3333),
                              ),
                              Icon(
                                Icons.keyboard_arrow_down_outlined,
                                size: 12.sp,
                                color: ColorsUtils.parseColorFromHexString(
                                    ColorsUtils.colorCccc),
                              )
                            ],
                          ),
                          Container(
                            alignment: Alignment.centerLeft,
                            padding: EdgeInsets.only(top: 5.h),
                            child: Row(
                              children: [
                                Container(
                                  constraints: BoxConstraints.expand(
                                      width: 50.w, height: 20.h),
                                  alignment: Alignment.center,
                                  decoration: BoxDecoration(
                                      color: ColorsUtils.rgba(5, 178, 136, 1),
                                      borderRadius: BorderRadius.only(
                                          topLeft: Radius.circular(3.w),
                                          bottomLeft: Radius.circular(3.w))),
                                  child: Text(
                                    '无忧退',
                                    style: StylesUtils.customTextStyle(
                                        fontSize: 12.sp),
                                  ),
                                ),
                                Container(
                                  height: 20.h,
                                  alignment: Alignment.centerLeft,
                                  decoration: BoxDecoration(
                                      border: Border(
                                          bottom: BorderSide(
                                              color: ColorsUtils.rgba(
                                                  5, 178, 136, 1)))),
                                  child: Text(
                                    ' 随时退 • 过期自动退',
                                    style: StylesUtils.textStyle(
                                      color: ColorsUtils.rgba(5, 178, 136, 1),
                                      fontSize: 12.sp,
                                    ),
                                  ),
                                )
                              ],
                            ),
                          )
                        ],
                      ),
                    ),
                    Container(
                      padding: EdgeInsets.symmetric(vertical: 20.h),
                      alignment: Alignment.centerLeft,
                      child: Row(
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: [
                          Text(
                            '景区意外险（含新冠保障）x2份',
                            style: StylesUtils.customTextStyle(
                                fontSize: 16.sp, color: ColorsUtils.color3333),
                          ),
                          Icon(
                            Icons.arrow_forward_ios,
                            size: 12.sp,
                            color: ColorsUtils.parseColorFromHexString(
                                ColorsUtils.colorCccc),
                          )
                        ],
                      ),
                    )
                  ],
                ),
              ),
              Container(
                height: 100,
                margin: EdgeInsets.only(top: 10.h),
                decoration: BoxDecoration(
                    color: Colors.white,
                    borderRadius: BorderRadius.circular(8.w)),
                child: Column(
                  children: [
                    Expanded(
                        child: Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [
                        Text.rich(TextSpan(children: [
                          TextSpan(
                              text: '在线支付',
                              style: StylesUtils.customTextStyle(
                                  color: ColorsUtils.color3333,
                                  fontSize: 16.sp,
                                  fontWeight: FontWeight.w700)),
                          TextSpan(
                              text: ' ￥ ',
                              style: StylesUtils.customTextStyle(
                                  fontSize: 16.sp,
                                  color: ColorsUtils.colorD900)),
                          TextSpan(
                              text: '60',
                              style: StylesUtils.customTextStyle(
                                  fontSize: 18.sp,
                                  color: ColorsUtils.colorD900))
                        ])),
                        Text(
                          '费用明细',
                          style: StylesUtils.customTextStyle(
                              color: ColorsUtils.color6799, fontSize: 12.sp),
                        )
                      ],
                    )),
                    Expanded(
                        child: Container(
                            alignment: Alignment.centerLeft,
                            child: Text.rich(TextSpan(
                                children: [
                                  TextSpan(
                                      text: '订单号 231125173310086 ',
                                      style: StylesUtils.customTextStyle(
                                          fontSize: 12.sp,
                                          color: ColorsUtils.color6666)),
                                  WidgetSpan(
                                      child: ToolsUtils.assetImageSvg(
                                          'u1757.svg',
                                          width: 12.w,
                                          height: 12.h),
                                      alignment: PlaceholderAlignment.middle)
                                ],
                                recognizer: TapGestureRecognizer()
                                  ..onTap = () {
                                    FlutterClipboard.copy('231125173310086')
                                        .then((value) => showToast('复制完毕',
                                            context: context,
                                            position:
                                                StyledToastPosition.bottom))
                                        .catchError((err) => showToast('复制失败',
                                            context: context,
                                            position:
                                                StyledToastPosition.bottom));
                                  }))))
                  ],
                ),
              ),
              Container(
                margin: EdgeInsets.only(top: 10.h),
                decoration: BoxDecoration(
                    color: Colors.white,
                    borderRadius: BorderRadius.circular(8.w)),
                child: Column(
                  children: [
                    Container(
                      alignment: Alignment.centerLeft,
                      padding: EdgeInsets.only(bottom: 10.h),
                      child: Text(
                        '预定信息',
                        style: StylesUtils.customTextStyle(
                            fontSize: 17.sp, color: ColorsUtils.color3333),
                      ),
                    ),
                    Row(
                      children: [
                        Container(
                          width: 80.w,
                          alignment: Alignment.centerLeft,
                          child: Text(
                            '出行人',
                            style: StylesUtils.customTextStyle(
                                color: ColorsUtils.color9999, fontSize: 13.sp),
                          ),
                        ),
                        Expanded(
                            child: Container(
                          alignment: Alignment.centerLeft,
                          child: Text(
                            '柳宗元',
                            style: StylesUtils.customTextStyle(
                                color: ColorsUtils.color3333, fontSize: 13.sp),
                          ),
                        ))
                      ],
                    ),
                    Container(
                      padding: EdgeInsets.symmetric(vertical: 15.h),
                      child: Row(
                        children: [
                          Container(
                            width: 80.w,
                            alignment: Alignment.centerLeft,
                            child: Text(
                              '联系信息',
                              style: StylesUtils.customTextStyle(
                                  color: ColorsUtils.color9999,
                                  fontSize: 13.sp),
                            ),
                          ),
                          Expanded(
                              child: Container(
                            alignment: Alignment.centerLeft,
                            child: Text(
                              '柳宗元  136****5678',
                              style: StylesUtils.customTextStyle(
                                  color: ColorsUtils.color3333,
                                  fontSize: 13.sp),
                            ),
                          ))
                        ],
                      ),
                    ),
                    Row(
                      children: [
                        Container(
                          width: 80.w,
                          alignment: Alignment.centerLeft,
                          child: Text(
                            '合同条款',
                            style: StylesUtils.customTextStyle(
                                color: ColorsUtils.color9999, fontSize: 13.sp),
                          ),
                        ),
                        Expanded(
                            child: Row(
                                mainAxisAlignment:
                                    MainAxisAlignment.spaceBetween,
                                children: [
                              Text(
                                '2024-02-01 12:14:17',
                                style: StylesUtils.customTextStyle(
                                    color: ColorsUtils.color3333,
                                    fontSize: 13.sp),
                              ),
                              RichText(
                                  text: TextSpan(
                                      text: '详情',
                                      style: StylesUtils.customTextStyle(
                                          fontSize: 12.sp,
                                          color: ColorsUtils.color6799),
                                      recognizer: TapGestureRecognizer()
                                        ..onTap = () {}))
                            ]))
                      ],
                    ),
                  ],
                ),
              ),
              Container(
                height: 90,
                margin: EdgeInsets.only(top: 10.h),
                padding: const EdgeInsets.all(15),
                decoration: BoxDecoration(
                    color: Colors.white,
                    borderRadius: BorderRadius.circular(8.w),
                    border:
                        Border.all(color: ColorsUtils.rgba(252, 252, 252, 1))),
                child: Row(
                  children: [
                    Center(
                        child: ClipRRect(
                      borderRadius: BorderRadius.circular(5.w),
                      child: Image.network(
                        'https://img1.baidu.com/it/u=1110297879,3226503213&fm=253&fmt=auto&app=138&f=JPEG?w=600&h=401',
                        width: 60,
                        height: 60,
                        fit: BoxFit.fill,
                      ),
                    )),
                    Expanded(
                        child: Container(
                      padding: EdgeInsets.only(left: 10.w),
                      alignment: Alignment.centerLeft,
                      child: Text(
                        '故宫博物馆',
                        style: StylesUtils.customTextStyle(
                            color: ColorsUtils.color3333, fontSize: 16.sp),
                      ),
                    )),
                    Center(
                      child: RichText(
                        text: TextSpan(
                            text: '景点详情 ',
                            style: StylesUtils.customTextStyle(
                                fontSize: 12.sp, color: ColorsUtils.color9999),
                            children: [
                              WidgetSpan(
                                  child: Icon(
                                    Icons.arrow_forward_ios,
                                    size: 12.sp,
                                    color: ColorsUtils.parseColorFromHexString(
                                        ColorsUtils.color9999),
                                  ),
                                  alignment: PlaceholderAlignment.middle)
                            ],
                            recognizer: TapGestureRecognizer()..onTap = () {}),
                      ),
                    )
                  ],
                ),
              ),
              Container(
                padding: EdgeInsets.only(top: 20.h),
                alignment: Alignment.center,
                child: Text(
                  '本产品由小默旅行发展有限公司及',
                  style: StylesUtils.customTextStyle(
                      fontSize: 12.sp, color: ColorsUtils.color9999),
                ),
              ),
              Container(
                padding: EdgeInsets.only(top: 5.h, bottom: 50.h),
                alignment: Alignment.center,
                child: Text(
                  '具有合法资质的供应商提供相关服务',
                  style: StylesUtils.customTextStyle(
                      color: ColorsUtils.color9999, fontSize: 12.sp),
                ),
              )
            ],
          ),
        ),
      ),
    );
  }
}

/// 已取消
class AdmissionCancelled extends StatefulWidget {
  const AdmissionCancelled({super.key});

  @override
  State<AdmissionCancelled> createState() => _AdmissionCancelledState();
}

class _AdmissionCancelledState extends State<AdmissionCancelled> {
  @override
  Widget build(BuildContext context) {
    return Transform.translate(
      offset: const Offset(0, -0.9),
      child: Container(
        padding: EdgeInsets.only(top: 10.h),
        color: ColorsUtils.parseColorFromHexString(ColorsUtils.colorF7f7),
        alignment: Alignment.center,
        child: SizedBox(
          width: 345,
          child: Column(
            children: [
              Container(
                height: 150,
                padding: EdgeInsets.symmetric(horizontal: 15.w, vertical: 10.h),
                alignment: Alignment.centerLeft,
                decoration: BoxDecoration(
                    color: Colors.white,
                    borderRadius: BorderRadius.circular(8.w)),
                child: Column(
                  children: [
                    Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [
                        Text(
                          '故宫博物馆学生票 x2份',
                          style: StylesUtils.customTextStyle(
                            color: ColorsUtils.color3333,
                          ),
                        ),
                        Icon(
                          Icons.arrow_forward_ios,
                          size: 12.sp,
                          color: ColorsUtils.parseColorFromHexString(
                              ColorsUtils.colorCccc),
                        )
                      ],
                    ),
                    Container(
                      padding: EdgeInsets.only(top: 8.h),
                      alignment: Alignment.centerLeft,
                      child: Text.rich(TextSpan(
                          text: '使用日期：',
                          style: StylesUtils.customTextStyle(
                              fontSize: 12.sp, color: ColorsUtils.color9999),
                          children: [
                            TextSpan(
                                text: '2023-11-26 星期六',
                                style: StylesUtils.customTextStyle(
                                    fontSize: 12.sp,
                                    color: ColorsUtils.colorFf99))
                          ])),
                    ),
                    const DashedLine(
                      dashedLength: 10,
                      // color: Colors.pink,
                      position: DashedLinePosition.mid,
                      child: SizedBox(
                        height: 60,
                        width: double.infinity,
                      ),
                    ),
                    Container(
                      alignment: Alignment.centerLeft,
                      child: Row(
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: [
                          Text(
                            '景区意外险（含新冠保障）x2份',
                            style: StylesUtils.customTextStyle(
                                fontSize: 16.sp, color: ColorsUtils.color3333),
                          ),
                          Icon(
                            Icons.arrow_forward_ios,
                            size: 12.sp,
                            color: ColorsUtils.parseColorFromHexString(
                                ColorsUtils.colorCccc),
                          )
                        ],
                      ),
                    ),
                  ],
                ),
              ),
              Container(
                margin: EdgeInsets.only(top: 10.h),
                height: 100,
                padding: EdgeInsets.symmetric(vertical: 10, horizontal: 15.w),
                decoration: BoxDecoration(
                    color: Colors.white,
                    borderRadius: BorderRadius.circular(8.w)),
                child: Column(
                  children: [
                    Expanded(
                        child: Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [
                        Text.rich(TextSpan(children: [
                          TextSpan(
                              text: '在线支付',
                              style: StylesUtils.customTextStyle(
                                  color: ColorsUtils.color3333,
                                  fontSize: 16.sp,
                                  fontWeight: FontWeight.w700)),
                          TextSpan(
                              text: ' ￥ ',
                              style: StylesUtils.customTextStyle(
                                  fontSize: 16.sp,
                                  color: ColorsUtils.colorD900)),
                          TextSpan(
                              text: '60',
                              style: StylesUtils.customTextStyle(
                                  fontSize: 18.sp,
                                  color: ColorsUtils.colorD900))
                        ])),
                        Text(
                          '费用明细',
                          style: StylesUtils.customTextStyle(
                              color: ColorsUtils.color6799, fontSize: 12.sp),
                        )
                      ],
                    )),
                    Expanded(
                        child: Container(
                            alignment: Alignment.centerLeft,
                            child: Text.rich(TextSpan(
                                children: [
                                  TextSpan(
                                      text: '订单号 231125173310086 ',
                                      style: StylesUtils.customTextStyle(
                                          fontSize: 12.sp,
                                          color: ColorsUtils.color6666)),
                                  WidgetSpan(
                                      child: ToolsUtils.assetImageSvg(
                                          'u1757.svg',
                                          width: 12.w,
                                          height: 12.h),
                                      alignment: PlaceholderAlignment.middle)
                                ],
                                recognizer: TapGestureRecognizer()
                                  ..onTap = () {
                                    FlutterClipboard.copy('231125173310086')
                                        .then((value) => showToast('复制完毕',
                                            context: context,
                                            position:
                                                StyledToastPosition.bottom))
                                        .catchError((err) => showToast('复制失败',
                                            context: context,
                                            position:
                                                StyledToastPosition.bottom));
                                  }))))
                  ],
                ),
              ),
              Container(
                margin: EdgeInsets.only(top: 10.h),
                padding: EdgeInsets.symmetric(vertical: 10, horizontal: 15.w),
                decoration: BoxDecoration(
                    color: Colors.white,
                    borderRadius: BorderRadius.circular(8.w)),
                child: Column(
                  children: [
                    Container(
                      alignment: Alignment.centerLeft,
                      padding: EdgeInsets.only(bottom: 10.h),
                      child: Text(
                        '预定信息',
                        style: StylesUtils.customTextStyle(
                            fontSize: 17.sp, color: ColorsUtils.color3333),
                      ),
                    ),
                    Row(
                      children: [
                        Container(
                          width: 80.w,
                          alignment: Alignment.centerLeft,
                          child: Text(
                            '出行人',
                            style: StylesUtils.customTextStyle(
                                color: ColorsUtils.color9999, fontSize: 13.sp),
                          ),
                        ),
                        Expanded(
                            child: Container(
                          alignment: Alignment.centerLeft,
                          child: Text(
                            '柳宗元',
                            style: StylesUtils.customTextStyle(
                                color: ColorsUtils.color3333, fontSize: 13.sp),
                          ),
                        ))
                      ],
                    ),
                    Container(
                      padding: EdgeInsets.symmetric(vertical: 15.h),
                      child: Row(
                        children: [
                          Container(
                            width: 80.w,
                            alignment: Alignment.centerLeft,
                            child: Text(
                              '联系信息',
                              style: StylesUtils.customTextStyle(
                                  color: ColorsUtils.color9999,
                                  fontSize: 13.sp),
                            ),
                          ),
                          Expanded(
                              child: Container(
                            alignment: Alignment.centerLeft,
                            child: Text(
                              '柳宗元  136****5678',
                              style: StylesUtils.customTextStyle(
                                  color: ColorsUtils.color3333,
                                  fontSize: 13.sp),
                            ),
                          ))
                        ],
                      ),
                    ),
                    Row(
                      children: [
                        Container(
                          width: 80.w,
                          alignment: Alignment.centerLeft,
                          child: Text(
                            '合同条款',
                            style: StylesUtils.customTextStyle(
                                color: ColorsUtils.color9999, fontSize: 13.sp),
                          ),
                        ),
                        Expanded(
                            child: Row(
                                mainAxisAlignment:
                                    MainAxisAlignment.spaceBetween,
                                children: [
                              Text(
                                '2024-02-01 12:14:17',
                                style: StylesUtils.customTextStyle(
                                    color: ColorsUtils.color3333,
                                    fontSize: 13.sp),
                              ),
                              RichText(
                                  text: TextSpan(
                                      text: '详情',
                                      style: StylesUtils.customTextStyle(
                                          fontSize: 12.sp,
                                          color: ColorsUtils.color6799),
                                      recognizer: TapGestureRecognizer()
                                        ..onTap = () {}))
                            ]))
                      ],
                    ),
                  ],
                ),
              ),
              Container(
                height: 90,
                margin: EdgeInsets.only(top: 10.h),
                padding: const EdgeInsets.all(15),
                decoration: BoxDecoration(
                    color: Colors.white,
                    borderRadius: BorderRadius.circular(8.w),
                    border:
                        Border.all(color: ColorsUtils.rgba(252, 252, 252, 1))),
                child: Row(
                  children: [
                    Center(
                        child: ClipRRect(
                      borderRadius: BorderRadius.circular(5.w),
                      child: Image.network(
                        'https://img1.baidu.com/it/u=1110297879,3226503213&fm=253&fmt=auto&app=138&f=JPEG?w=600&h=401',
                        width: 60,
                        height: 60,
                        fit: BoxFit.fill,
                      ),
                    )),
                    Expanded(
                        child: Container(
                      padding: EdgeInsets.only(left: 10.w),
                      alignment: Alignment.centerLeft,
                      child: Text(
                        '故宫博物馆',
                        style: StylesUtils.customTextStyle(
                            color: ColorsUtils.color3333, fontSize: 16.sp),
                      ),
                    )),
                    Center(
                      child: RichText(
                        text: TextSpan(
                            text: '景点详情 ',
                            style: StylesUtils.customTextStyle(
                                fontSize: 12.sp, color: ColorsUtils.color9999),
                            children: [
                              WidgetSpan(
                                  child: Icon(
                                    Icons.arrow_forward_ios,
                                    size: 12.sp,
                                    color: ColorsUtils.parseColorFromHexString(
                                        ColorsUtils.color9999),
                                  ),
                                  alignment: PlaceholderAlignment.middle)
                            ],
                            recognizer: TapGestureRecognizer()..onTap = () {}),
                      ),
                    )
                  ],
                ),
              ),
              Container(
                padding: EdgeInsets.only(top: 20.h),
                alignment: Alignment.center,
                child: Text(
                  '本产品由小默旅行发展有限公司及',
                  style: StylesUtils.customTextStyle(
                      fontSize: 12.sp, color: ColorsUtils.color9999),
                ),
              ),
              Container(
                padding: EdgeInsets.only(top: 5.h, bottom: 50.h),
                alignment: Alignment.center,
                child: Text(
                  '具有合法资质的供应商提供相关服务',
                  style: StylesUtils.customTextStyle(
                      color: ColorsUtils.color9999, fontSize: 12.sp),
                ),
              )
            ],
          ),
        ),
      ),
    );
  }
}

/// 已使用
class AdmissionUsed extends StatefulWidget {
  const AdmissionUsed({super.key});

  @override
  State<AdmissionUsed> createState() => _AdmissionUsedState();
}

class _AdmissionUsedState extends State<AdmissionUsed> {
  @override
  Widget build(BuildContext context) {
    return Transform.translate(
      offset: const Offset(0, -0.9),
      child: Container(
        padding: EdgeInsets.only(top: 10.h),
        color: ColorsUtils.parseColorFromHexString(ColorsUtils.colorF7f7),
        alignment: Alignment.center,
        child: SizedBox(
          width: 345,
          child: Column(
            children: [
              Container(
                height: 150,
                padding: EdgeInsets.symmetric(horizontal: 15.w, vertical: 10.h),
                alignment: Alignment.centerLeft,
                decoration: BoxDecoration(
                    color: Colors.white,
                    borderRadius: BorderRadius.circular(8.w)),
                child: Column(
                  children: [
                    Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [
                        Text(
                          '故宫博物馆学生票 x2份',
                          style: StylesUtils.customTextStyle(
                            color: ColorsUtils.color3333,
                          ),
                        ),
                        Icon(
                          Icons.arrow_forward_ios,
                          size: 12.sp,
                          color: ColorsUtils.parseColorFromHexString(
                              ColorsUtils.colorCccc),
                        )
                      ],
                    ),
                    Container(
                      padding: EdgeInsets.only(top: 8.h),
                      alignment: Alignment.centerLeft,
                      child: Text.rich(TextSpan(
                          text: '使用日期：',
                          style: StylesUtils.customTextStyle(
                              fontSize: 12.sp, color: ColorsUtils.color9999),
                          children: [
                            TextSpan(
                                text: '2023-11-26 星期六',
                                style: StylesUtils.customTextStyle(
                                    fontSize: 12.sp,
                                    color: ColorsUtils.colorFf99))
                          ])),
                    ),
                    const DashedLine(
                      dashedLength: 10,
                      // color: Colors.pink,
                      position: DashedLinePosition.mid,
                      child: SizedBox(
                        height: 60,
                        width: double.infinity,
                      ),
                    ),
                    Container(
                      alignment: Alignment.centerLeft,
                      child: Row(
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: [
                          Text(
                            '景区意外险（含新冠保障）x2份',
                            style: StylesUtils.customTextStyle(
                                fontSize: 16.sp, color: ColorsUtils.color3333),
                          ),
                          Icon(
                            Icons.arrow_forward_ios,
                            size: 12.sp,
                            color: ColorsUtils.parseColorFromHexString(
                                ColorsUtils.colorCccc),
                          )
                        ],
                      ),
                    ),
                  ],
                ),
              ),
              Container(
                margin: EdgeInsets.only(top: 10.h),
                height: 100,
                padding: EdgeInsets.symmetric(vertical: 10, horizontal: 15.w),
                decoration: BoxDecoration(
                    color: Colors.white,
                    borderRadius: BorderRadius.circular(8.w)),
                child: Column(
                  children: [
                    Expanded(
                        child: Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [
                        Text.rich(TextSpan(children: [
                          TextSpan(
                              text: '在线支付',
                              style: StylesUtils.customTextStyle(
                                  color: ColorsUtils.color3333,
                                  fontSize: 16.sp,
                                  fontWeight: FontWeight.w700)),
                          TextSpan(
                              text: ' ￥ ',
                              style: StylesUtils.customTextStyle(
                                  fontSize: 16.sp,
                                  color: ColorsUtils.colorD900)),
                          TextSpan(
                              text: '60',
                              style: StylesUtils.customTextStyle(
                                  fontSize: 18.sp,
                                  color: ColorsUtils.colorD900))
                        ])),
                        Text(
                          '费用明细',
                          style: StylesUtils.customTextStyle(
                              color: ColorsUtils.color6799, fontSize: 12.sp),
                        )
                      ],
                    )),
                    Expanded(
                        child: Container(
                            alignment: Alignment.centerLeft,
                            child: Text.rich(TextSpan(
                                children: [
                                  TextSpan(
                                      text: '订单号 231125173310086 ',
                                      style: StylesUtils.customTextStyle(
                                          fontSize: 12.sp,
                                          color: ColorsUtils.color6666)),
                                  WidgetSpan(
                                      child: ToolsUtils.assetImageSvg(
                                          'u1757.svg',
                                          width: 12.w,
                                          height: 12.h),
                                      alignment: PlaceholderAlignment.middle)
                                ],
                                recognizer: TapGestureRecognizer()
                                  ..onTap = () {
                                    FlutterClipboard.copy('231125173310086')
                                        .then((value) => showToast('复制完毕',
                                            context: context,
                                            position:
                                                StyledToastPosition.bottom))
                                        .catchError((err) => showToast('复制失败',
                                            context: context,
                                            position:
                                                StyledToastPosition.bottom));
                                  }))))
                  ],
                ),
              ),
              Container(
                margin: EdgeInsets.only(top: 10.h),
                padding: EdgeInsets.symmetric(vertical: 10, horizontal: 15.w),
                decoration: BoxDecoration(
                    color: Colors.white,
                    borderRadius: BorderRadius.circular(8.w)),
                child: Column(
                  children: [
                    Container(
                      alignment: Alignment.centerLeft,
                      padding: EdgeInsets.only(bottom: 10.h),
                      child: Text(
                        '预定信息',
                        style: StylesUtils.customTextStyle(
                            fontSize: 17.sp, color: ColorsUtils.color3333),
                      ),
                    ),
                    Row(
                      children: [
                        Container(
                          width: 80.w,
                          alignment: Alignment.centerLeft,
                          child: Text(
                            '出行人',
                            style: StylesUtils.customTextStyle(
                                color: ColorsUtils.color9999, fontSize: 13.sp),
                          ),
                        ),
                        Expanded(
                            child: Container(
                          alignment: Alignment.centerLeft,
                          child: Text(
                            '柳宗元',
                            style: StylesUtils.customTextStyle(
                                color: ColorsUtils.color3333, fontSize: 13.sp),
                          ),
                        ))
                      ],
                    ),
                    Container(
                      padding: EdgeInsets.symmetric(vertical: 15.h),
                      child: Row(
                        children: [
                          Container(
                            width: 80.w,
                            alignment: Alignment.centerLeft,
                            child: Text(
                              '联系信息',
                              style: StylesUtils.customTextStyle(
                                  color: ColorsUtils.color9999,
                                  fontSize: 13.sp),
                            ),
                          ),
                          Expanded(
                              child: Container(
                            alignment: Alignment.centerLeft,
                            child: Text(
                              '柳宗元  136****5678',
                              style: StylesUtils.customTextStyle(
                                  color: ColorsUtils.color3333,
                                  fontSize: 13.sp),
                            ),
                          ))
                        ],
                      ),
                    ),
                    Row(
                      children: [
                        Container(
                          width: 80.w,
                          alignment: Alignment.centerLeft,
                          child: Text(
                            '合同条款',
                            style: StylesUtils.customTextStyle(
                                color: ColorsUtils.color9999, fontSize: 13.sp),
                          ),
                        ),
                        Expanded(
                            child: Row(
                                mainAxisAlignment:
                                    MainAxisAlignment.spaceBetween,
                                children: [
                              Text(
                                '2024-02-01 12:14:17',
                                style: StylesUtils.customTextStyle(
                                    color: ColorsUtils.color3333,
                                    fontSize: 13.sp),
                              ),
                              RichText(
                                  text: TextSpan(
                                      text: '详情',
                                      style: StylesUtils.customTextStyle(
                                          fontSize: 12.sp,
                                          color: ColorsUtils.color6799),
                                      recognizer: TapGestureRecognizer()
                                        ..onTap = () {}))
                            ]))
                      ],
                    ),
                  ],
                ),
              ),
              Container(
                height: 90,
                margin: EdgeInsets.only(top: 10.h),
                padding: const EdgeInsets.all(15),
                decoration: BoxDecoration(
                    color: Colors.white,
                    borderRadius: BorderRadius.circular(8.w),
                    border:
                        Border.all(color: ColorsUtils.rgba(252, 252, 252, 1))),
                child: Row(
                  children: [
                    Center(
                        child: ClipRRect(
                      borderRadius: BorderRadius.circular(5.w),
                      child: Image.network(
                        'https://img1.baidu.com/it/u=1110297879,3226503213&fm=253&fmt=auto&app=138&f=JPEG?w=600&h=401',
                        width: 60,
                        height: 60,
                        fit: BoxFit.fill,
                      ),
                    )),
                    Expanded(
                        child: Container(
                      padding: EdgeInsets.only(left: 10.w),
                      alignment: Alignment.centerLeft,
                      child: Text(
                        '故宫博物馆',
                        style: StylesUtils.customTextStyle(
                            color: ColorsUtils.color3333, fontSize: 16.sp),
                      ),
                    )),
                    Center(
                      child: RichText(
                        text: TextSpan(
                            text: '景点详情 ',
                            style: StylesUtils.customTextStyle(
                                fontSize: 12.sp, color: ColorsUtils.color9999),
                            children: [
                              WidgetSpan(
                                  child: Icon(
                                    Icons.arrow_forward_ios,
                                    size: 12.sp,
                                    color: ColorsUtils.parseColorFromHexString(
                                        ColorsUtils.color9999),
                                  ),
                                  alignment: PlaceholderAlignment.middle)
                            ],
                            recognizer: TapGestureRecognizer()..onTap = () {}),
                      ),
                    )
                  ],
                ),
              ),
              Container(
                padding: EdgeInsets.only(top: 20.h),
                alignment: Alignment.center,
                child: Text(
                  '本产品由小默旅行发展有限公司及',
                  style: StylesUtils.customTextStyle(
                      fontSize: 12.sp, color: ColorsUtils.color9999),
                ),
              ),
              Container(
                padding: EdgeInsets.only(top: 5.h, bottom: 50.h),
                alignment: Alignment.center,
                child: Text(
                  '具有合法资质的供应商提供相关服务',
                  style: StylesUtils.customTextStyle(
                      color: ColorsUtils.color9999, fontSize: 12.sp),
                ),
              )
            ],
          ),
        ),
      ),
    );
  }
}
